package playground.fibu.ejb;

import playground.fibu.ejb.dao.AccountDAO;
import playground.fibu.ejb.dao.BookingDAO;
import playground.fibu.ejb.dao.DAOFactory;
import playground.fibu.ejb.dao.FibuDAOException;
import playground.fibu.ejb.dao.mysql.MySQLDAOFactory;
import playground.fibu.ejb.entity.Account;
import playground.fibu.ejb.entity.Booking;

public class FibuHandler {

	public static void main(String[] args) {

		DAOFactory factory = (MySQLDAOFactory) DAOFactory
				.getDAOFactory(DAOFactory.MYSQL);
		
		AccountDAO accDAO = factory.getAccountDAO();
		BookingDAO bkingDAO = factory.getBookingDAO();
		
		try {
			Account acc = accDAO.findByName("CS Konto");
		} catch (FibuDAOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		
//		Booking booking = new Booking();
//		booking.setAmount(100.00);
//		booking.setText("TEST");
//		booking.setDebitAccount(acc);
//		
//		try {
//			bkingDAO.save(booking);
//			
//		} catch (FibuDAOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
	}
}
